package com.sunnada.btfvilg.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sunnada.btfvilg.entity.Deliverylist;
import com.sunnada.btfvilg.entity.Deliveryman;
import com.sunnada.btfvilg.mapper.DeliverylistMapper;
import com.sunnada.btfvilg.mapper.DeliverymanMapper;
import com.sunnada.btfvilg.model.request.DeliParamVo;
import com.sunnada.btfvilg.service.DeliveryService;
import com.sunnada.btfvilg.service.DeliverymanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author zsl
 * @title DeliveryServiceImpl
 * @description: TODO
 */
@Service
public class DeliveryServiceImpl extends ServiceImpl<DeliverylistMapper, Deliverylist> implements DeliveryService {

    @Autowired(required = false)
    private DeliverylistMapper deliverylistMapper;

    @Override
    public void addDeliverylist(DeliParamVo deliParamVo) {
        Deliverylist deliverylist=new Deliverylist();
        deliverylist.setDid(deliParamVo.getDid());
        deliverylist.setSid(deliParamVo.getSid());
        deliverylist.setPid(deliParamVo.getPid());
        deliverylistMapper.insert(deliverylist);
    }

    @Override
    public void updateDeliverylist(DeliParamVo deliParamVo) {
        Deliverylist deliverylist=new Deliverylist();
        deliverylist.setDid(deliParamVo.getDid());
        deliverylist.setSid(deliParamVo.getSid());
        deliverylist.setPid(deliParamVo.getPid());
        deliverylistMapper.updateById(deliverylist);
    }
}
